home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 1 / CU Amiga Magazine CD-ROM Special Edition (1995)(EMAP Images)(GB)[Issue 1995-11].iso / Aminet / comm / bbs / ACSDD110.lha / Developer / DreamDoor / Sas_C / Example / testlib.c
C/C++ Source or Header  |  1995-02-18  |  946b  |  47 lines

  1. /*
  2.  
  3.   ***********************************************************************
  4.  
  5.      Simple example file to show how to use the DDDoor.library from C
  6.  
  7.   ***********************************************************************
  8.  
  9. */
  10.  
  11. #include <stdio.h>
  12. #include <stdlib.h>
  13. #include <string.h>
  14. #include <proto/dddoor.h>
  15. #include <libraries/dddoor.h>
  16. #include <proto/exec.h>
  17. #include <proto/dos.h>
  18. #include <daydream.h>
  19. #include <exec/memory.h>
  20.  
  21. struct    Library    *DDBase;
  22. struct    DIFace    *d;
  23.  
  24. int main(int argc, char *argv[])
  25. {
  26.     DDBase=(struct Library *)OpenLibrary("dreamdoor.library",1);
  27.     if(DDBase==NULL)
  28.     {
  29.         printf("Needs DreamDoor.library V1.00+ to run\n");
  30.         exit(10);
  31.     }
  32.     d=InitDoor(argv[1]);        /* Establish link with DD */
  33.  
  34.     if(d==NULL)
  35.         {
  36.         printf("This Program Requires Microsoft Windows V3.1!\n");
  37.         CloseLibrary(DDBase);
  38.             exit(10);
  39.         }
  40.     
  41.     SendString(d,"Hello World!\n");
  42.     
  43.     CloseDoor(d);
  44.     CloseLibrary(DDBase);
  45.      exit(0);
  46. }
  47.